﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using SampleTryouts.Models;

// such a simplistic test to understand how the MS UnitTest works.
// This unit test is used to test the functionality of the MinimumDiscountHelper Object only.

namespace SampleTryouts.Tests
{
    [TestClass]
    public class UnitTest1
    {
        private IDiscountHelper getTestObject()
        {
            return new MinimumDiscountHelper();
        }

        // test to provide a 10% discount on the total when the total amount is > $100
        [TestMethod]
        public void Discount_Above_100()
        {
            // arrange
            IDiscountHelper target = getTestObject();
            decimal total = 200;

            // act
            string outDescription = string.Empty;
            var discountedTotal = target.ApplyDiscount(total
                //, out outDescription
                );

            //assert
            Assert.AreEqual(total * 0.9M, discountedTotal);
            Assert.AreEqual(outDescription, "Amount more than $100, so 10% discount applied");

        }
    }
}
